<template>
    <el-card>
      <menu-nav :list="navList"></menu-nav>

      <div class='app-container'>
        <div class='tip-div' v-if="user_exam_info.page_tip_enable=='enabled'">
          <div class='tip-content' >
            <div style="white-space: pre-line;" v-html="user_exam_info.download_userinfo_enable_txt || user_exam_info.page_tip"></div>
          </div>
        </div>

        <div  v-if='user_exam_info.download_userinfo_enable =="enabled"'>
          <el-row>
            <el-button type="primary" @click="onDownloadCert" :disabled='user_exam_info.download_userinfo_enable =="disabled"'>点击下载考生信息</el-button>
          </el-row>
          <div ><span style="white-space: pre-line;" v-html="info.cert_content"></span></div>
        </div>
        <el-empty  v-else description="暂未开放"></el-empty>
      </div>
      <!-- <el-empty  v-else description="暂未开放"></el-empty> -->

    </el-card>
</template>

<script>
import http from '@/utils/http'
// import api from '@/api_kaowu'
  export default {
    props:['user_exam_info'],
    data () {
      return {
        navList: [
          { label: '考生信息', href: '/personal/kaowu/kaoshenginfo', name: '/personal/kaowu/kaoshenginfo', active: true },
        ],
        info:null,
      }
    },
    computed: {
        basic () {
            return this.$store.state.resume.basic
        }
    },
    created () {
      this.init()
    },
    methods:{
        onDownloadCert() {
          let that = this;
          let $promise = http.post('/kaowu/userset/downloadExamKaoshengInfo')
          $promise.then((res)=>{
            that.$message.success(res.message)
            if(res.code == 200){
              window.open(res.data.url)
            }

          })


        },
        // 初始化数据
        init() {
            this.getExamKaoshengInfo();
        },



        getExamKaoshengInfo(){
          http.post('/kaowu/userget/getExamKaoshengInfo',{}).then(res=>{
            this.info = res.data
          })

        },

    }
  }
</script>

<style lang="scss" scoped>
  .tip-div{padding:15px;background-color: #fafafa;width: 100%;min-height: 80px;line-height:20px;border-left:5px solid red;margin-bottom:30px;}
  .input-hidden {
        position: absolute;
    }
    .tip-content{
      white-space:pre-wrap;
      color:red;
      font-size:16px;
      line-height:24px;
    }
  .app-container{background:#fff;overflow:auto;}
  .avatar-uploader .el-upload {
      border: 1px dashed #d9d9d9;
      border-radius: 6px;
      cursor: pointer;
      position: relative;
      overflow: hidden;
    }
    .avatar-uploader .el-upload:hover {
      border-color: #409EFF;
    }
    .avatar-uploader-icon {
      font-size: 28px;
      color: #8c939d;
      width: 178px;
      height: 178px;
      line-height: 178px;
      text-align: center;
    }
    .avatar {
      width: 178px;
      height: 178px;
      display: block;
    }
</style>
